style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>Line in Program:
style=3D'font-family:"Calibri","sans-serif";color:windowtext '>//connect
to server and select database
style=3D'font-family:"Calibri","sans-serif";color:windowtext '>//connect
to server and select database
style=3D'font-family:"Calibri","sans-serif";color:windowtext '>$mysqli
=3D mysqli_connect("localhost", "jdoe", =
"doepass",
"testdb");
style=3D'font-family:"Calibri","sans-serif";color:windowtext '> =
style=3D'font-family:"Calibri","sans-serif";color:windowtext '>//create
and issue the query
style=3D'font-family:"Calibri","sans-serif";color:windowtext '>$sql
=3D "SELECT f_name, l_name FROM auth_users WHERE username =3D
'".$_POST["username"]."' AND password =3D
PASSWORD('".$_POST["password"]."')";<=
/span>
style=3D'font-family:"Calibri","sans-serif";color:windowtext '>$result
=3D mysqli_query($mysqli, $sql) or =
die(mysqli_error($mysqli));
style=3D'font-family:"Calibri","sans-serif";color:windowtext '> =
style=3D'font-family:"Calibri","sans-serif";color:windowtext '> =
style=3D'font-size:14.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>Record in mySQl =
database: &nbs=
p;  =
; =
&=
nbsp; &n=
bsp; &nb=
sp; &nbs=
p; =
Users
PASSWORD
id f_name l_name email username password
href=3D"http://localhost/phpmyadmin/tbl_change.php?db=3Dtest DB&table=3D=
auth_users&primary_key=3D+%60auth_users%60.%60id%60+%3D+ 1&sql_que=
ry=3DSELECT+%2A+FROM+%60auth_users%60&goto=3Dsql.php& ;token=3D2e38=
a21d8832de9283320672387b55c7">
style=3D'color:blue;text-decoration:none'>
height=3D16
id=3D"Picture_x0020_26" src=3D"cid:image002.png@01CA0FC8.1577F7A0" =
alt=3DEdit>
href=3D"http://localhost/phpmyadmin/sql.php?db=3DtestDB& table=3Dauth_=
users&sql_query=3DDELETE+FROM+%60testDB%60.%60auth_users %60+WHERE+%60=
auth_users%60.%60id%60+%3D+1+LIMIT+1&zero_rows=3DThe+row +has+been+del=
eted&goto=3Dsql.php%3Fdb%3DtestDB%26table%3Dauth_users%2 6sql_query%3D=
SELECT%2B%252A%2BFROM%2B%2560auth_users%2560%26zero_rows%3DT he%2Brow%2Bha=
s%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3D2e38 a21d8832de928=
3320672387b55c7&token=3D2e38a21d8832de9283320672387b55c7 ">
style=3D'color:blue;text-decoration:none'>
height=3D16
id=3D"Picture_x0020_27" src=3D"cid:image003.png@01CA0FC8.1577F7A0" =
alt=3DDelete>1
John Doe john@doe.com =
j=
doe
*0AAD74=
4979343D58A7F17A50E514E6AD6533D04B
style=3D'font-size:11.0pt;font-family:"Ancestory =
SF";color:windowtext'>
style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'>
style=3D'font-size:14.0pt'>
Message from =
Firefox Browser:
style=3D'font-size:13.5pt'>Warning
class=3Dapple-style-span>: =
mysqli_connect() [
href=3D"http://localhost/AllInOne/25/function.mysqli-connect ">function.my=
sqli-connect]:
(28000/1045): Access denied for user 'jdoe'@'localhost' (using password: =
YES)
in
style=3D'font-size:13.5pt'>
class=3Dapple-style-span>
style=3D'font-size:13.5pt'>C:\wamp\www\rogers\userlogin.php
pan>
class=3Dapple-converted-space>
style=3D'font-size:13.5pt'>
class=3Dapple-style-span>on =
line
class=3Dapple-converted-space>
style=3D'font-size:13.5pt'>
class=3Dapple-style-span>
style=3D'font-size:13.5pt'>9
style=3D'font-size:13.5pt'>
Warning: mysqli_query() expects =
parameter 1
to be mysqli, boolean given in
class=3Dapple-converted-space>
class=3Dapple-style-span>C:\wamp\www\rogers\userlogin.php
pan
class=3Dapple-converted-space>
class=3Dapple-style-span>on line
class=3Dapple-converted-space>
class=3Dapple-style-span>13
Warning: mysqli_error() expects =
parameter 1
to be mysqli, boolean given in
class=3Dapple-converted-space>
class=3Dapple-style-span>C:\wamp\www\rogers\userlogin.php
pan
class=3Dapple-converted-space>
class=3Dapple-style-span>on line
class=3Dapple-converted-space>
class=3Dapple-style-span>13
style=3D'font-size:13.5pt'>
style=3D'font-size:13.5pt'>This
one has got me.
style=3D'font-size:13.5pt'>Please
Help.
style=3D'font-size:13.5pt'>
style=3D'font-size:13.5pt'>..../Ernie
Re: Access Denied
am 29.07.2009 03:50:27 von List Manager
Ernie Kemp wrote:
>
>
> Line in Program:
>
> //connect to server and select database
>
> //connect to server and select database
>
> $mysqli = mysqli_connect("localhost", "jdoe", "doepass", "testdb");
>
>
>
> //create and issue the query
>
> $sql = "SELECT f_name, l_name FROM auth_users WHERE username =
> '".$_POST["username"]."' AND password = PASSWORD('".$_POST["password"]."')";
>
> $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));
>
>
>
>
>
> Record in mySQl database:
> Users PASSWORD
>
> id f_name l_name email username password
>
> ry_key=+%60auth_users%60.%60id%60+%3D+1&sql_query=SELECT+%2A +FROM+%60auth_us
> ers%60&goto=sql.php&token=2e38a21d8832de9283320672387b55c7> Edit
>
> LETE+FROM+%60testDB%60.%60auth_users%60+WHERE+%60auth_users% 60.%60id%60+%3D+
> 1+LIMIT+1&zero_rows=The+row+has+been+deleted&goto=sql.php%3F db%3DtestDB%26ta
> ble%3Dauth_users%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560 auth_users%2560%
> 26zero_rows%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_ structure.php%26
> token%3D2e38a21d8832de9283320672387b55c7&token=2e38a21d8832d e9283320672387b5
> 5c7> Delete1 John Doe john@doe.com jdoe
> *0AAD744979343D58A7F17A50E514E6AD6533D04B
>
>
>
>
>
> Message from Firefox Browser:
>
> Warning: mysqli_connect() [function.mysqli-connect
> ]: (28000/1045):
> Access denied for user 'jdoe'@'localhost' (using password: YES) in
> C:\wamp\www\rogers\userlogin.php on line 9
>
Ok, not to be harsh, but I thought I would point it out before others jumped on this one.
The answer to your question is in the question itself.
Access denied for user 'jdoe'@'localhost' (using password: YES) in
C:\wamp\www\rogers\userlogin.php on line 9
So, since line 9 is your mysqli_connect() call, I would suggest looking at the manual page for that.
http://php.net/mysqli_connect
Plus look at mysql documentation on how to create a new user, grant them privileges, and flush the
privileges table.
http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
A simple Google search would have brought you to these pages.
As for the reset of the errors. Fix the first one and the others might be fixed also.
Jim
> Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in
> C:\wamp\www\rogers\userlogin.php on line 13
>
> Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in
> C:\wamp\www\rogers\userlogin.php on line 13
>
>
>
> This one has got me.
>
> Please Help.
>
>
>
> ..../Ernie
>
>
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php